This application claims priority to an application entitled xe2x80x9cAPPARATUS AND METHOD FOR CONVERTING OF PIXELS FROM YUV TO RGB FORMAT USING COLOR LOOK-UP TABLESxe2x80x9d, filed in the Korean Industrial Property Office on Jun. 24, 2002 and assigned Serial No. 2002-35313, the contents of which are hereby incorporated by reference.
1. Field of the Invention
The present invention relates to a method for processing video signals, and more particularly to an apparatus and a method for converting pixels from a YUV format to a RGB format using color look-up tables with a small memory capacity.
2. Description of the Related Art
Usually, a RGB format and a YUV format are kinds of color modes for representing colors of pixels of an image in visible media. The RGB format is a mode for separating color signals into color components of R (Red), G (Green), and B (Blue) color, i.e., three primary colors of light used when video display devices such as a CRT (Cathode Ray Tube) or a LCD (Liquid Crystal Display) create colors or images. The YUV format is a mode for separating color signals into a luminance component (Y component) representing a brightness, and chrominance components (U and V components) representing color. Herein, the U component represents a blue color, and the Y component represents a red color.
In order to display colors, the RGB format requires at least three color-difference data, thereby needing a large memory capacity. However, since the RGB format employs the same displaying method as that of the video display device, this mode has excellent color-separation and transmission effects. On the other hand, the YUV format has poorer color-separation and transmission effects than the RGB format, but has an advantage in expressing a large number of colors even using a few color data.
Typically, most graphic cards use the YUV format in processing data. Generally, not only a digital video capturing device such as a CCD (Charge-Coupled Device) or a CMOS (Complementary Metal-Oxide Semiconductor) sensor but also a video decoder with a video compression standard such as a MPEG (Moving Picture Experts Group Standards) 1, 2, 4, or H.261, 263, 26L, or etc. uses an output format in the YUV mode. Therefore, in order to display pixels in the YUV format outputted from the camera or the video decoder in a digital video product device on the CRT or the LCD, the pixels must be converted into the RGB format.
This color model conversion from the YUV format to the RGB format is accomplished by equations representing the relationship between the YUV format and the RGB format. In the equations for converting the pixels between the YUV format and the RGB format, different statistical weight values are respectively distributed to the R, G, and B components according to their sensitivities to human vision. Therefore, various equations are applied according to the distribution methods of the statistical weight values. Among the various equations, four or five equations have been often used. One equation is defined as follows.
R=1.164*(Yxe2x88x9216)+1.596*(Vxe2x88x92128)
G=1.164*(Yxe2x88x9216)xe2x88x920.813*(Vxe2x88x92128)xe2x88x920.391*(Uxe2x88x92128)
B=1.164*(Yxe2x88x9216)+2.018*(Uxe2x88x92128)xe2x80x83xe2x80x83[Equation 1]
Using the above-described Equation 1, the R, G, and B component values are obtained from hardware-based multipliers and adders. That is, the R and B component values are obtained from two multipliers and one adder, and the G component value is obtained from three multipliers and two adders.
As above-described, the color model conversional operations of Equation 1 are implemented by the hardware. Since the hardware occupies a large space, the hardware is not proper to be employed by a small-sized mobile communication terminal. Further, in multiplication operations of Equation 1, the statistical weight values to the Y, U, and V component values are not integers but decimal fractions with a floating point, thereby complicating the design of the hardware and increasing the size of the hardware chip. Moreover, interfaces between the hardware device for the color model conversion and the camera or video decoder are changed by the kinds of the cameras or video decoders, thereby reducing generalization.
On the other hand, the color model conversional operations of Equation 1 may be implemented by software. However, the statistical weight values to the Y, U, and V component values are also decimal fractions with a floating point, thereby requiring a large number of instructions. These operations impose a heavy burden on a microprocessor of a mobile communication terminal with more limited computing power than a general desktop computer.
MPEG ISO/IEC 13818-2 Section 6.3.6 states a method for converting the statistical weight values of Equation 1 into integers in order to convert a color mode of a mobile communication terminal, as follows.
R=76309*(Yxe2x88x9216)+crv*(Vxe2x88x92128)+32768 greater than  greater than 16
G=76309*(Yxe2x88x9216)xe2x88x92cgu*(Uxe2x88x92128)xe2x88x92cgv*(Vxe2x88x92128)+32768 greater than  greater than 16
B=76309*(Yxe2x88x9216)+cbu*(Uxe2x88x92128)+32768 greater than  greater than 16xe2x80x83xe2x80x83[Equation 2]
Herein, crv, cgu, cgv, and cbu are statistical weight values differently given by respective International Standard Organizations. These values are described in the following Table 1.
As above-described, in Equation 2, the statistical weight values applied to the Y, U, and V component values are integers. Further, since shift operations requiring instructions with a smaller number than the multiplication operations are used, the number of the instructions required in Equation 2 is much smaller than Equation 1.
However, most of microprocessors perform multiplication operations slower than addition or subtraction operations. Further, most of microprocessors perform a table access operations faster than multiplication operations. Moreover, in case an apparatus for converting the color mode is implemented as the above-described hardware, an interface method between a video CODEC for decoding a compressed image and generating Y, U, and V component values and a video display device must be fixed. Thus, when a type of the video CODEC to be used is changed or upgraded, the interface must be amended. Therefore, it is preferable to use color look-up tables instead of multipliers. Many conventional methods for converting a color mode using color look-up tables are known by several documents, e.g., U.S. Pat. No. 5,936,683.
In using the color look-up tables, a necessary memory capacity is determined by the size of the color look-up table. The size of the color look-up table is changed by the number of variables used as indexes. For example, U.S. Pat. No. 5,936,683 discloses color look-up tables using two variables as indexes. In order to use two variables as indexes, since a color look-up table must represent all combinational cases of two variables, the size of the color look-up table becomes larger than that of a color look-up table using one variable as an index. Therefore, it requires that the size of the color look-up table must be reduced by decreasing the number of variables used as indexes.
As the number of color look-up tables increases, a larger memory capacity for storing the color look-up tables is required. Therefore, in order to reduce the memory capacity, it is necessary to decrease the number of the color look-up tables. In the case of Equation 2, if one color look-up table is used for each conversional formula used, the color model conversion can be accomplished by only three color look-up tables. However, in this case, the color look-up tables use two or three variables as indexes, thereby considerably increasing the sizes of the color look-up tables. Therefore, in order to accomplish the color model conversion with the minimum memory capacity, it is necessary to properly adjust the numbers and the sizes of the color look-up tables.
Therefore, the present invention has been made in view of the above problems, and it is an object of the present invention to provide an apparatus and a method for converting pixels from a YUV format to RGB format using color look-up tables.
It is another object of the present invention to provide an apparatus and a method for converting a color mode by reducing the sizes and numbers of look-up tables with a small memory capacity.
In accordance with one aspect of the present invention, the above and other objects can be accomplished by the provision of an apparatus for converting a color mode using at least five look-up tables respectively using one index and at least three adders.
In accordance with another aspect of the present invention, there is provided to in a system for converting pixels from a YUV format including a Y component representing luminance and U and V components representing chrominance to a RGB format including R, G, and B components respectively representing red, green, and blue colors using color look-up tables in order to display images on a video display device, a method for generating pixels in the YUV format including the Y, U, and V components from encoded video signals, obtaining the R component value from respective partial values of the Y and V components to the R component, obtaining the G component value from respective partial values of the Y, U, and V components to the G component, and obtaining the B component value from respective partial values of the Y and U components to the B component. The method comprises the steps of: inputting a Y component value of the generated pixel to a first color look-up table, selecting the partial values of the Y component to the R, G, B components from the first color look-up table corresponding to the inputted Y component value, and respectively outputting the selected partial values to first, second, and third adders; inputting a V component value of the generated pixel to second and third color look-up tables, respectively selecting the partial values of the V component to the R and G components from the second and third color look-up tables corresponding to the inputted V component value, and respectively outputting the selected partial values to the first and second adders; inputting a U component value of the generated pixel to fourth and fifth color look-up tables, respectively selecting the partial values of the U component to the G and B component from the fourth and fifth color look-up tables corresponding to the inputted U component value, and respectively outputting the selected partial values to the second and third adders; and obtaining R, G, and B component values from added values of the partial values using the first, second, and third adders.